<template>
	<view class="container">
		<view id="heardtouxiang">
			<image src="../../static/img/shuijiao.jpg"></image>
			<text>昵称</text>
		</view>

		<view class="panel">
			<view class="media-heard">
				<text>我的订单</text>
				<text @click="myorder(0)">查看全部></text>
			</view>
			<view id="myorder">
				<view class="myorder-item" @click="myorder(1)">
					<uni-icon type="home-filled" color="#007aff" size="40"></uni-icon>
					<text class="item-right">待发货</text>
				</view>
				<view class="myorder-item" @click="myorder(2)">
					<uni-icon type="info-filled" color="#dd524d" size="40"></uni-icon>
					<text>待收货</text>
				</view>
				<view class="myorder-item" @click="myorder(3)">
					<uni-icon type="checkbox-filled" color="#4cd964" size="40"></uni-icon>
					<text>已完成</text>
				</view>
			</view>
		</view>
		<view  class="panel">
			<uni-list>
				<uni-list-item title="收到的礼物">
				</uni-list-item>
				<uni-list-item title="购物车" show-badge="true" badgeType="success" @click="openwin('cart/cart')" badge-text="12">
				</uni-list-item>
				<uni-list-item title="优惠券" show-badge="true" badge-type="error" @click="openwin('user/coupon-list')" badge-text="2">
				</uni-list-item>
				<uni-list-item title="联系客服">
				</uni-list-item>
			</uni-list>
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			myorder(index){
				uni.navigateTo({
					url: `/pages/user/order-list?tabIndex=${index}`
				})
			},
			openwin(navurl){
				console.log(navurl);
				uni.navigateTo({
					url: `/pages/${navurl}`
				})
			}
		}
	}
</script>

<style lang='scss'>
	page,
	.container {
		background-color: $uni-bg-color-hui;
	}

	#heardtouxiang {
		display: flex;
		font-size: $uni-font-size-sm;
		background-color: $uni-bg-color;
		align-items: center;
		justify-content: center;
		height: 350upx;
	}

	#heardtouxiang image {
		width: 150upx;
		height: 150upx;
		border-radius: 75upx;
	}

	.media-heard {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		font-size: $uni-font-size-lg;
		padding-bottom: 10upx;
		margin: 10upx 20upx 20upx 20upx;
		border-bottom: $uni-text-color-disable solid 2upx;
	}

	.panel {
		margin-top: 30upx;
		display: flex;
		flex-direction: column;
		background-color: $uni-bg-color;
	}

	#myorder {
		display: flex;
		flex-direction: row;
		padding-bottom: 20upx;
		justify-content: space-around;
	}

	.myorder-item {
		width: 190upx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.myorder-item text{
		font-size: $uni-font-size-lg;
	}
</style>
